package com.lanou3g.code0410.counter;

/**
 * Created by dllo on 18/4/10.
 */
public class OperatorFactory {
    //根据操作符(+ - * /)
    //来生成指定计算类
    //工厂模式
    public static Operator getOperator(String op){
        Operator operator=null;
        switch (op){
            case "+":
                operator= new OpAdd();
                break;
            case "-":
                operator= new OpSub();
                break;
        }return operator;
    }
}
